import React, { Component } from 'react';
import DutyWeek from './DutyWeek';
import $ from 'jquery';
import './scss/DutyWeekCenter.scss';
import LgTopBar from './common/header/Header'
import FlowChart from './common/flowChart'
class DutyWeekCenter extends Component {
    constructor(props) {
        super(props);
        this.state = {
            start: -1,
            termInfo: JSON.parse(sessionStorage.getItem("termInfo")),
        }
    }
    updateTermInfo = (newTermInfo, index,) => {
        this.setState({ termInfo: newTermInfo, start: index });
    };
    render() {
        let { termInfo, start } = this.state
        return (
            <div>
                <LgTopBar updateTermInfo={this.updateTermInfo} termInfo={termInfo} ></LgTopBar>
                <div className={"DutyWeek-div " + (sessionStorage.getItem('isManage') !== '1' ? 'DutyWeek-div-teacher' : '')}>
                    {/* {
                        sessionStorage.getItem('isManage') == '1' ?
                            <FlowChart></FlowChart>
                            : ''
                    } */}
                    <DutyWeek termInfo={termInfo} key={start} ></DutyWeek>
                </div>
            </div>
        )
    }
}

export default DutyWeekCenter;